package cn.dd.crmweb.modules.norm.controller;


import cn.dd.crmweb.common.Result;
import cn.dd.crmweb.modules.fact.entity.Fact;
import cn.dd.crmweb.modules.norm.entity.Norm;
import cn.dd.crmweb.modules.norm.service.INormService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("norm")
public class NormController {

    @Autowired
    private INormService normService;

    /**
     * 查询所有
     * @return
     */
    @GetMapping("list")
    public Result findAll(){
        return Result.success(normService.list());
    }

    /**
     * 新增或更新
     */
    @PostMapping("/add")
    public boolean save(@RequestBody Norm norm){
        return normService.saveOrUpdate(norm);
    }
}
